package com.itheima.Jiuye14;

import java.util.concurrent.CountDownLatch;

public class Chile3 extends Thread {
    private CountDownLatch countDownLatch;
    public Chile3(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }
    @Override
    public void run() {
        //吃饺子
        for (int i = 1; i <= 5; i++) {
        System.out.println(getName()+"在吃第"+i+"个饺子");
        }
        //吃完说一声吃完了
        //每次调用countDown ，计数器就就减1
        countDownLatch.countDown();
        //super.run();
    }
}
